<template>
    <view class="pub_page pub_header_padding pub_page_bg">
        <pub-head headerName="document" :headerConfig="headerConfig"></pub-head>

        <div class="content">
            <img style="width:100%;height:auto" v-for="(li,key) in adInfo" :key="key" :src="li.image">
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            pagescrollTop: 0,
            headerConfig: {
                title: 'BEGIN',//标题栏内容
                left_type: 3,
                header_color: 'rgba(0,0,0,0)',//标题栏背景色
            },

            adKey: '',
            adInfo: ''
        };
    },
    onLoad(option) {
        this.adKey = option.key || 0;
        this.getAdInfo();
        // #ifndef APP-PLUS
        if (process.env.NODE_ENV != 'development') {
            this.headerConfig.left_type = 0;
        }
        // #endif
    },
    onPageScroll(res) {
        this.pagescrollTop = res.scrollTop;
    },
    methods: {
        async getAdInfo() {
            this.$comFun.openLoading();
            const res = await this.$request.get('public/getAd', {
                key: this.adKey
            });
            // console.log(res);
            this.$comFun.closeLoading();
            if (res.code == 200 && res.result) {
                this.adInfo = res.result;
            }
        },
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/other.scss";
</style>
